Structures
The following structures are available globally.
-
A type-erased
Codablevalue.The
AnyCodabletype forwards encoding and decoding responsibilities to an underlying value, hiding its specific underlying type.You can encode or decode mixed-type values in dictionaries and other collections that require
EncodableorDecodableconformance by declaring their contained type to beAnyCodable.See also
AnyEncodableSee moreSee also
AnyDecodableDeclaration
Swift
@frozen struct AnyCodableextension AnyCodable : Copyable, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Escapable, ExpressibleByArrayLiteral, ExpressibleByBooleanLiteral, ExpressibleByDictionaryLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByFloatLiteral, ExpressibleByIntegerLiteral, ExpressibleByNilLiteral, ExpressibleByStringInterpolation, ExpressibleByStringLiteral, ExpressibleByUnicodeScalarLiteral, Hashable, Sendable, _AnyDecodable, _AnyEncodable -
A type-erased
Decodablevalue.The
AnyDecodabletype forwards decoding responsibilities to an underlying value, hiding its specific underlying type.You can decode mixed-type values in dictionaries and other collections that require
Decodableconformance by declaring their contained type to beAnyDecodable:let json = “”“ { "boolean”: true, “integer”: 42, “double”: 3.141592653589793, “string”: “string”, “array”: [1, 2, 3], “nested”: { “a”: “alpha”, “b”: “bravo”, “c”: “charlie” }, “null”: null } “”“.data(using: .utf8)!
let decoder = JSONDecoder() let dictionary = try! decoder.decode([String: AnyDecodable].self, from: json)
See moreDeclaration
Swift
@frozen struct AnyDecodableextension AnyDecodable : Copyable, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Equatable, Escapable, Hashable, _AnyDecodable -
A type-erased
Encodablevalue.The
AnyEncodabletype forwards encoding responsibilities to an underlying value, hiding its specific underlying type.You can encode mixed-type values in dictionaries and other collections that require
Encodableconformance by declaring their contained type to beAnyEncodable:let dictionary: [String: AnyEncodable] = [ “boolean”: true, “integer”: 42, “double”: 3.141592653589793, “string”: “string”, “array”: [1, 2, 3], “nested”: [ “a”: “alpha”, “b”: “bravo”, “c”: “charlie” ], “null”: nil ]
let encoder = JSONEncoder() let json = try! encoder.encode(dictionary)
See moreDeclaration
Swift
@frozen struct AnyEncodableextension AnyEncodable : Copyable, CustomDebugStringConvertible, CustomStringConvertible, Encodable, Equatable, Escapable, ExpressibleByArrayLiteral, ExpressibleByBooleanLiteral, ExpressibleByDictionaryLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByFloatLiteral, ExpressibleByIntegerLiteral, ExpressibleByNilLiteral, ExpressibleByStringInterpolation, ExpressibleByStringLiteral, ExpressibleByUnicodeScalarLiteral, Hashable, _AnyEncodable -
LicenseSpring error.
See moreDeclaration
Swift
struct LSErrorextension LSError : Copyable, CustomNSError, Error, Escapable, Sendable -
Encapsulates information about overages in a consumption license. Can be passed to
See moreLicenseService.syncConsumptionif you want to include overage info in the request.Declaration
Swift
struct OverageRequestextension OverageRequest : Decodable, Encodable, Equatable
Structures Reference